home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-03-19 | 24.9 KB | 579 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Globals.Lib
- #
- # Contains: Used to define globals
- #
- # Written by: KTA, ML, et al
- #
- # Copyright: © 1993-1996 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # 1.1.212> 6/18/96 MDF Added global gIsBothMethods to correctly handle both
- # test case logging methods.
- # .1.211+> 6/18/96 MDF Added global gIsBothMethods to correctly handle both test case
- # logging methods.
- # 1.1.211> 6/17/96 MDF Modified comparisons of gTestCaseLoggingMethod against it's
- # possible values.
- # .1.210+> 6/17/96 MDF
- # 1.1.210> 6/17/96 MDF Modified checks for gTestCaseLoggingMethod against
- # ResultsExpress reporting versus Tracs reporting.
- # 1.1.29+> 6/17/96 MDF Modified checks for gTestCaseLoggingMethod against
- # ResultsExpress reporting versus Tracs reporting.
- # <1.1.29> 2/23/96 JC Add TRACS support.
- # 1.1.28+> 2/23/96 JC Add TRACS support.
- # <1.1.28> 11/13/95 ML InitGlobals() - add initing TCSlogging constants
- # 1.1.27+> 11/13/95 ML InitGlobals() - add initing TCSlogging constants
- # <1.1.27> 5/18/95 ML corrected SPEC version
- # 1.1.26+> 5/18/95 ML corrected SPEC version
- # <1.1.26> 5/18/95 ML changed SPECVersion to global gSPECVersion for Clouseau
- # compatibility checking
- # 1.1.25+> 5/18/95 ML changed SPECVersion to global gSPECVersion for Clouseau
- # compatibility checking
- # <1.1.25> 5/8/95 ML Removed global gLogStrCount - now we check it in logstr().
- # <1.1.24> 3/29/95 ML InitGlobals() - Don't default gAdditionalTargetInfo,
- # gPrintSuiteInfo to ON
- # 1.1.23+> 3/29/95 ML
- # <1.1.23> 3/14/95 ML InitGlobals() - add gAdditionalTargetInfo,
- # gSpecialErrorHandlers, gPrintSuiteInfo, gLaunchReqs
- # 1.1.22+> 3/14/95 ML
- # <1.1.22> 3/13/95 ML set gVerifyAppPriorToLaunch on by default
- # 1.1.21+> 3/13/95 ML
- # <1.1.21> 3/10/95 ML InitGlobals() - Remove incorrect "not" from SPEC_1_2_based
- # check, correctly set SPEC_1_2_based, check if
- # gExceptionHandlerList is defined
- # 1.1.20+> 3/9/95 ML InitGlobals () - remove incorrect "not"
- # <1.1.20> 2/28/95 KTA InitGlobals() - Added gMacroCommands to the list that can be
- # passed in with pGlobalsDefList.
- # <1.1.19> 2/28/95 ML Marked
- # <1.1.18> 2/23/95 KTA SetTestLevel() - Fixed example in header and added more detail
- # about test methods / InitGlobals() - Added more information
- # about parameters to the header
- # <1.1.17> 2/16/95 ML InitGlobals() - Make sure command timeout set to 130
- # <1.1.16> 2/16/95 ML InitGlobals() - don't add new error handlers if gCrashHandling
- # is off
- # <1.1.15> 2/6/95 ML InitGlobals() - default gCrashHandling to ON if undefined,
- # default pGlobalsDefList to undefined, added check for pre 1.2
- # script, initialize different gExceptionHandlerList if pre 1.2
- # script, Added global gSPECVersion and pass into suite desc, if
- # not(global gCrashHandling) , AddExceptionHandler for -1096
- # <1.1.14> 2/1/95 KTA Added crashHandler parameters
- # <1.1.13> 1/31/95 KTA InitGlobals() - Added gCrashHandling.
- # <1.1.12> 1/31/95 KTA Added gInitGlobalsThreadingHook
- # <1.1.11> 1/31/95 KTA Changed CrashHandler.Lib toCrashHandling.lib
- # <1.1.10> 1/27/95 KTA SetTestLevel() - fixed illegal Expression in 'WindowLevel' /
- # InitGlobals() - Added -1100 exceptionhandler for the
- # crashHandler
- # <1.1.9> 1/27/95 ML Set correct command timeouts for exception handling
- # <1.1.8> 1/25/95 ML Correct typo when defining gAppVerify
- # <1.1.7> 1/19/95 ML Default commandExceptions to ON. Change gErrorList to
- # gExceptionHandlerList. Change DefaultErrorHandler to
- # DefaultExceptionHandler
- # <1.1.6> 1/19/95 KTA Added a crashHandler to the default gErrList.
- # <1.1.5> 1/9/95 KTA SetTestLevel(), InitRandomSeed() - Changed Println calls to
- # Logstr() calls.
- # <1.1.4> 12/13/94 KTA Move ExitVU to TCS.Lib
- # <1.1.3> 12/13/94 ML Major globals optimizations (see individual tasks headers)
- # <1.1.2> 9/21/94 ML Revise Gestalt check for system version for VU 2.1 support,
- # temporarily add global for VU version and add VU version info to
- # Suite info
- # <1.1.1> 7/15/94 ML Correct globals declarations in InitRandomSeed()
- # <1.1.0> 5/4/94 KTA InitGlobals() - Font lists and Scrapbook are no longer
- # defined in resources. Removed BuildListFromResource().
- # 1.0.115> 4/20/94 ML Marked tasks
- # 1.0.114> 4/15/94 KTA InitGlobals() - Check to insure gLogLevel and gTCTracking are
- # undefined prior to assigning default values.
- # 1.0.113> 4/13/94 KTA InitGlobals() - changed gDBLogging to gTCTracking.
- # <1.0.112> 12/16/93 KTA Changed gFileToolOutput to gTestCaseLoggingMethod
- # <1.0.111> 12/14/93 KTA Removed Palantino from default gFontList.
- # <1.0.110> 12/2/93 KTA Fixed bug where it was not possible to set the randomSeed value
- # from the Custom.Lib.
- # <1.0.19> 9/23/93 KTA Moved gPreflight from TCS.Lib so it would be initialized at the
- # right time.
- # <1.0.18> 9/22/93 KTA Removed global gStopTimer it was not used, removed gScriptLevel
- # from globals, removed kScrapStyledTEXT, etc.
- # <1.0.17> 9/13/93 KTA Updated TestLevel specification.
- # <1.0.16> 9/10/93 KTA Added a definable test level for application specific tests -
- # gAppTestLevel.
- # <1.0.15> 9/2/93 KTA Fixed example in SetTestLevel()
- # <1.0.14> 9/1/93 KTA Added task ExitVU, and task reference to it - gExitVU.
- # <1.0.13> 8/25/93 KTA Added support for parity checking the TCS stack and Script
- # parameter to set test level.
- # <1.0.12> 8/20/93 KTA Moved TCS specific Globals, added gFileToolOutput and
- # gNoteBookOutput for FileTool output of Phoenix data.
- # <1.0.11> 7/20/93 KTA Bug Fix: I wiped out gBuildVers when fixing gIsSys7.
- # <1.0.10> 7/19/93 KTA Added customiation support: Dependancy on Custom.lib, call
- # InitCustom().
- # <1.0.9> 7/15/93 KTA Added TCSExpCount, and made a better check for gIsSys7 (for
- # PowerPC).
- # <1.0.8> 7/14/93 KTA Place some global variable strings into resources for
- # international support. gScraptitle, gFontlist, gFontStyleList,
- # gFontSizeList.
- # <1+> 5/21/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Custom.Lib", "ExceptionHandling.Lib", "Output.Lib", "CrashHandling.Lib", "TRACS.Lib";
-
- #########################################################################
- #################### GLOBALS #####################
- #########################################################################
- ### Global Library Definitions
- ### Generally:
- ### If current value is 0 or 1, new value must be a 0 or 1
- ### If current value is true or false, new value must be true or false
- ### If current value is a string, new value must be a string
- ### If current value is a list, new value must be a list.
- ###
- #########################################################################
- #########################################################################
- # InitGlobals()
- #========================================================================
- # Author: KTA
- # Description: Initializes most global variables used by the SPEC S&L.
- # This Task should be called prior to making any calls to
- # any tasks contained within the SPEC S&L Libraries
- # Please refer to 'The Hitchhikers Guide' for more information
- # concerning any individual global.
- # Parameters: pTheScriptParam - (list or integer)
- # - list - contains both parameters to SetTestLevel()
- # - integer - only first parameter to SetTestLevel()
- # (see SetTestLevel() header for more details)
- #
- # pGlobalsDefList - list of lists with each inner list containing a
- # label (string - name of the global) and a value for the global.
- # This enables the user to define globals through VU's
- # interface for individual scripts without having to
- # modify any SPEC S&L files (i.e. Custom.Lib)
- #
- # By providing a definition for a global, you will only
- # effect that specific global, all other globals are
- # given default values.
- #
- # The globals which can be defined are as follows:
- # 1) gCommandExceptions 2) gExceptionHandlerList
- # 3) gCrashHandling 4) gAppVerify
- # 5) gTestCaseLoggingMethod 6) gDebugFlag
- # 7) gTextStr 8) kScrapTEXT
- # 9) kScrapPICT 10) gScrapTitle
- # 11) gAliasDirectory 12) gTCTracking
- # 13) gPreFlight 14) gFontList
- # 15) gFontSizeList 16) gFontStyleList
- # 17) gSFPUTLocation 18) gPrintTest
- # 19) gDoWindowList 20) gBackgroundQuit
- # 21) gForceQuit 22) gSeedValue
- # 23) gMacroCommands 24) gAdditionalTargetInfo
- # 25) gSpecialErrorHandlers 26) gPrintSuiteInfo
- # 27) gLaunchReqs
- # Returns: Nothing
- # Examples: InitGlobals({2, {{'DrawLevel', 1}}}, {{'gSeedValue', 1542}, {'gCrashHandling', false}});
- # Assumptions:
- #========================================================================
- # History:
- # KTA 7/8/93 Added String Resources (intl)
- # KTA 7/14/93 Updated gIsSys7 check for PowerPC
- # KTA 4/13/94 Changed gDBLogging to gTCTracking
- # KTA 4/15/94 Check to insure gLogLevel and gTCTracking are undefined prior
- # to assigning default values.
- # KTA 5/4/94 Font lists and Scrapbook are no longer defined in resources.
- # ML 9/21/94 Revise Gestalt check for system version for VU 2.1 support
- # ML 9/21/94 temporarily add global for VU version and add to suite info
- # - remove when 2.1 ships!
- # ML 12/9/94 removed gTargetCheck, gNoteBookOutput,
- # gExitVU, gLogLevel, gDisableAllLogging,
- # gFillMemory, gFillMemApp, gSeedZero, gAppTitle
- # gAppVersion, gPrevAppTitle, gSFOriginalPath
- # ML 12/13/94 removed system version and PowerPC checks - moved to
- # InitTCSlogging.
- # Removed VU version checks - obsolete
- # ML 12/13/94 Added gCommandExceptions and gErrorList
- # ML 1/19/95 CommandExceptions default to on
- # Change gErrorList to gExceptionHandlerList
- # Change DefaultErrorHandler to DefaultExceptionHandler
- # ML 1/25/95 Correct typo when defining gAppVerify
- # ML 1/27/95 Set correct command timeouts for exception handling
- # ML 1/31/95 Added gInitGlobalsThreadingHook
- # ML 1/31/95 Added global gCrashHandling
- # ML 2/3/95 default gCrashHandling to ON if undefined
- # default pGlobalsDefList to undefined
- # added check for pre 1.2 script
- # initialize different gExceptionHandlerList if pre 1.2 script
- # Added global gSPECVersion and pass into suite desc
- # if not(global gCrashHandling) AddExceptionHandler for -1096
- # ML 2/16/95 don't add new error handlers if gCrashHandling is off
- # ML 2/16/95 InitGlobals() - Make sure command timeout set to 130
- # KTA 2/22/95 Added more information about parameters to the header
- # KTA 2/28/95 Added gMacroCommands to the list that can be passed in.
- # ML 3/9/95 Remove incorrect "not" from SPEC_1_2_based check
- # correctly set SPEC_1_2_based, check if gExceptionHandlerList
- # is defined
- # ML 3/13/95 set gVerifyAppPriorToLaunch on by default
- # ML 3/14/95 add gAdditionalTargetInfo, gSpecialErrorHandlers,
- # gPrintSuiteInfo, gLaunchReqs
- # ML 3/29/95 Don't default gAdditionalTargetInfo, gPrintSuiteInfo to ON
- # ML 5/8/95 Removed global gLogStrCount - now we check it in logstr()
- # ML 5/18/95 changed SPECVersion to global gSPECVersion for Clouseau
- # compatibility checking
- # ML 11/13/95 add initializing kTCSNoLoggingMethod and kTCSResultsExpressMethod
- # JC 2/20/96 Added global kTCS_TRACSFileToolMethod for TRACS support also added
- # a call to TRACS_DataCollection() with pTheScriptParam parameter.
- # MDF 06/17/96 Changed value of global kTCS_TRACSFileToolMethod to 2
- # (distinguish from value of global kTCSResultsExpressMethod).
- # Tracs reporting now default if gTestCaseLoggingMethod is left
- # undefined in pGlobalsDefList.
- # MDF 06/18/96 Added global gIsBothMethods to correctly handle both test case
- # logging methods.
- #########################################################################
- TASK InitGlobals(pTheScriptParam := -1, pGlobalsDefList := undefined)
- begin
-
- ## are we in a pre-1.2 based script - if so, pGlobalsDefList
- ## won't be defined
- if (IsUndefined (pGlobalsDefList))
- begin
- SPEC_1_2_based := 0;
- pGlobalsDefList := {};
- end;
- else
- SPEC_1_2_based := 1;
-
- ############## Exception Handling Globals ############
- ## Command Exception dictates whether VU will automatically throw VU Errors.
- global gCommandExceptions := assoc('gCommandExceptions',pGlobalsDefList);
- if (IsUndefined (gCommandExceptions))
- global gCommandExceptions := 1; # 1 to verify the application is expected
- CommandExceptions(gCommandExceptions);
-
- ## This list defines the tasks which will handle different errors
- ## If you have a need to change the default settings at runtime, you
- ## should call AddExceptionHandler() and RemoveExceptionHandler()
- global gExceptionHandlerList := assoc('gExceptionHandlerList',pGlobalsDefList);
- if (IsUndefined (gExceptionHandlerList))
- if (SPEC_1_2_based) # for SPEC 1.2 based scripts
- global gExceptionHandlerList :=
- {
- {-1096, {task DefaultCrashHandler, {1,1,1},1}}, # Target Restarted
- {-1100, {task DefaultCrashHandler, {1,1,1},1}}, # Target crashed
- {'Default', {task DefaultExceptionHandler, {1},0}} # Everything else
- };
- else # pre SPEC 1.2 scripts don't have a catch
- global gExceptionHandlerList :=
- {
- {-1096, {task DefaultCrashHandler, {1,1,1,-1096},0}}, # Target Restarted
- {-1100, {task DefaultCrashHandler, {1,1,1,-1100},0}}, # Target crashed
- {'Default', {task DefaultExceptionHandler, {1},0}} # Everything else
- };
-
- global gCrashHandling := assoc('gCrashHandling',pGlobalsDefList);
- if (IsUndefined (gCrashHandling))
- global gCrashHandling := 1;
-
- global gMacroCommands := assoc('gMacroCommands',pGlobalsDefList);
- if (IsUndefined (gMacroCommands))
- global gMacroCommands := 'HOW; WH; TD; HT; SC';
-
- global gSpecialErrorHandlers := assoc('gSpecialErrorHandlers',pGlobalsDefList); # to install any special error handlers
-
- ############## Misc Globals ############
- global gAppVerify := assoc('gAppVerify',pGlobalsDefList);
- if (IsUndefined (gAppVerify))
- global gAppVerify := 1; # 1 to verify the application is expected
-
- global gVerifyAppPriorToLaunch := assoc('gVerifyAppPriorToLaunch',pGlobalsDefList);
- if (IsUndefined (gVerifyAppPriorToLaunch))
- global gVerifyAppPriorToLaunch := 1; # 1 to verify the application alias is expected
-
- global gAdditionalTargetInfo := assoc('gAdditionalTargetInfo',pGlobalsDefList);
-
- global gPrintSuiteInfo := assoc('gPrintSuiteInfo',pGlobalsDefList);
-
- global gTestCaseLoggingMethod := assoc('gTestCaseLoggingMethod',pGlobalsDefList);
- if(IsUndefined (gTestCaseLoggingMethod))
- global gTestCaseLoggingMethod := 2;
-
- global gSPECVersion := '1.3';
- SPECVersionString := "SPEC S&L {gSPECVersion}";
- global gAddSuiteInfoFieldsRE := {{ 'Desc', SPECVersionString}};
-
- ############## Misc constants ############
- global gDebugFlag := assoc('gDebugFlag',pGlobalsDefList);
- global gTextStr := assoc('gTextStr',pGlobalsDefList);
- if not (gTextStr)
- global gTextStr := "How jumping gymnasts will level six piqued frogs, Jim!";
-
- ############## ScrapBook Constants ############
- global kScrapTEXT := assoc('kScrapTEXT',pGlobalsDefList);
- if not (kScrapTEXT)
- global kScrapTEXT := 1; # ScrapItem location of TEXT
-
- global kScrapPICT := assoc('kScrapPICT',pGlobalsDefList);
- if not (kScrapPICT)
- global kScrapPICT := 2; # ScrapItem location of PICT
-
- global gScrapTitle := assoc('gScrapTitle',pGlobalsDefList);
- if not (gScrapTitle)
- global gScrapTitle := 'Scrapbook';
-
- ############## Script Globals ############
- global gAliasDirectory := assoc('gAliasDirectory',pGlobalsDefList);
- if not (gAliasDirectory)
- global gAliasDirectory := "#Aliases"; # Location of Core app aliases ( found in Apple Menu )
-
- global gTCTracking := assoc('gTCTracking',pGlobalsDefList);
- if (IsUndefined(gTCTracking))
- global gTCTracking := 1; # Set to true to do Suite & TCS logging
-
- global gPreFlight := assoc('gPreFlight',pGlobalsDefList);
- if (IsUndefined(gPreFlight))
- global gPreFlight := 1; # Set to true if you want to be sure target can
- # run app (see PreFlight task)
-
- global gLaunchReqs := assoc('gLaunchReqs',pGlobalsDefList); # obtain launch requirements
-
- ############## font characteristic lists ############
- global gFontList := assoc('gFontList',pGlobalsDefList);
- if not (gFontList)
- global gFontList := { 'Chicago','Courier','Geneva','Helvetica','Monaco','New York','Times' };
-
- global gFontSizeList := assoc('gFontSizeList',pGlobalsDefList);
- if not (gFontSizeList)
- global gFontSizeList := { '9','10','12','14','18','24','36' };
-
- global gFontStyleList := assoc('gFontStyleList',pGlobalsDefList);
- if not (gFontStyleList)
- global gFontStyleList := { 'Bold','Italic','Outline','Underline','Shadow' };
-
- ############################################################################
- # gSFPUTLocation contains the path to the directory in which files will be saved
- # by the NameOK Task. If the list is empty files will be saved in the default dir
- # IMPORTANT: gSFPUTLocation is a list
- # for example: global gSFPUTLocation := {"hd" };
- ############################################################################
- global gSFPUTLocation := assoc('gSFPUTLocation',pGlobalsDefList);
-
- ############## Print Global ############
- global gPrintTest := assoc('gPrintTest',pGlobalsDefList); # If true print test will be executed
-
- ############## DoWindows Globals ############
- global gDoWindowList := assoc('gDoWindowList',pGlobalsDefList);
- if not (gDoWindowList)
- global gDoWindowList := {1,1,1,1};
- # Set each element to 1 or 0. Flag for performing DoWindows tests as follows:
- # Element: 1 - Sizing
- # 2 - Scrolling
- # 3 - Dragging
- # 4 - Zooming
-
- ############## Launching/Quitting Globals ##################################
- # Quit() will close all windows, Launchtwitch() will background quit apps
- global gBackgroundQuit := assoc('gBackgroundQuit',pGlobalsDefList);
-
- # Overrides gBackgroundQuit. Quit() does nothing, Launchtwitch() will
- # twitch to and quit apps until it can complete launch.
- global gForceQuit := assoc('gForceQuit',pGlobalsDefList);
-
- ############## Random Seeding Globals ##################################
- global gSeedValue := assoc('gSeedValue',pGlobalsDefList);
- # set seed value if reproducing tests. Undefined
- # generates a random seed value
-
- ############################################################################
- ####### DO NOT modify any of the following GLOBAL Settings - ############
- ############################################################################
-
- if(TypeOf(pTheScriptParam) = 'list')
- SetTestLevel(pTheScriptParam[1],pTheScriptParam[2]);
- else if(TypeOf(pTheScriptParam) = 'integer')
- begin
- if(pTheScriptParam = -1) # Default setting for the scriptParam
- SetTestLevel(1); # Default to Quicklook
- else
- SetTestLevel(pTheScriptParam);
- end;
-
- ##################################################
- ### Test Case Logging Method Constants
- ##################################################
-
- global kTCSNoLoggingMethod := 0;
- global kTCSResultsExpressMethod := 1;
- global kTCS_TRACSFileToolMethod := 2;
-
- ### gTestCaseLoggingMethod can have the following values:
- # 0 - no test case logging
- # 1 - log test cases using Results Express
- # 2 - log test cases by creating TRACS import file on host
- # 3 - log test cases with Results Express and TRACS
-
- if((gTestCaseLoggingMethod & kTCSResultsExpressMethod) and (gTestCaseLoggingMethod & kTCS_TRACSFileToolMethod))
- global gIsBothMethods := TRUE;
- else
- global gIsBothMethods := FALSE;
-
- InitCustom(); # Call to initialize any custom defined globals
-
- if (CommandExceptions()) # if we're throwing VU exceptions
- begin
- if (CommandTimeout() < 130) # make sure timeout set to 130
- begin
- logstr('Command timeout reset to 130 for proper exception handling');
- CommandTimeout(130);
- end;
- end;
-
- if(global gInitGlobalsThreadingHook)
- call(gInitGlobalsThreadingHook);
-
- InitRandomSeed();
-
- if ((gTestCaseLoggingMethod = kTCS_TRACSFileToolMethod) or gIsBothMethods)
- begin
- logstr('TRACS import data will be generated using FileTool on the host');
-
- global gTRACS_OutputData := {}; #Private Global for TRACS Output
-
- pTheScriptParam := {{"The Script Param", pTheScriptParam }};
-
- TRACS_DataCollection(pTheScriptParam, 0);
- end;
- else
- logstr('TRACS import data will not be generated');
-
-
- end; # InitGlobals
-
- #########################################################################
- # InitRandomSeed()
- #========================================================================
- # Author: ML
- # Description: Initializes the random seed.
- # Parameters: None
- # Returns: Nada
- # Examples: InitRandomSeed();
- # Assumptions:
- #========================================================================
- # History:
- # ML 7/15/94 Correct globals declarations
- # ML 12/13/94 Removed gSeedZero
- # KTA 1/9/95 Changes Println call to Logstr() call.
- ########################################################################
- TASK InitRandomSeed()
- begin
- global gSeedValue;
- if (IsUndefined(gSeedValue))
- gSeedValue:= random(); # generate a random seed
-
- randomseed(gSeedValue); # seed the random number generator
-
- LogStr("The seed value is {gSeedValue}"); # print out the seed value for posterity
-
- end; # InitRandomSeed()
-
- #########################################################################
- # SetTestLevel(pTestLevel := 1, pCustomSetting := {})
- #========================================================================
- # Author: KTA
- # Description: Will set globals that will determine the level of testing
- # that will occur in the DoTests.
- # Parameters: pTestLevel := Generic level of testing desired.
- # 1 - least amount of testing
- # 2 - medium amount of testing
- # 3 - Most amount of testing
- # pCustomSetting - Any Custom settings, this will override the
- # generic settings for any specified global setting.
- # Returns:
- # Examples: SetTestLevel( 1, {{'DrawLevel', {1,2}}} );
- # Assumptions: Note : the labels used to set individual methods are as follows:
- # 1) DrawLevel
- # 2) FontLevel
- # 3) WindowLevel
- # 4) AppTestLevel
- #========================================================================
- # History:
- # KTA 9/9/93 Added support for gAppTestLevel
- # KTA 1/9/95 Changes Println calls to Logstr() calls.
- # KTA 1/27/95 Fixed illegal expression with 'WindowLevel'
- # KTA 2/23/95 Fixed example in header and added more detail about test methods
- #########################################################################
- TASK SetTestLevel(pTestLevel := 1, pCustomSetting := {})
- begin
- if(pTestLevel = 0)
- begin
- LogStr( "==== The test level is '{pTestLevel}' - (Turn all DoTests - OFF) =====");
-
- global gFontLevel := 0;
- global gDrawLevel := 0;
- global gWindowLevel := 0;
- global gAppTestLevel := 0;
- end;
- else if(pTestLevel = 1)
- begin
- LogStr("==== The test level is '{pTestLevel}' - (Minimum amount of testing) =====");
-
- global gFontLevel := 1;
- global gDrawLevel := 1;
- global gWindowLevel := 1;
- global gAppTestLevel := 1;
- end;
- else if(pTestLevel = 2)
- begin
- LogStr("==== The test level is '{pTestLevel}' - (Medium amount of testing) =====");
-
- global gFontLevel := 2;
- global gDrawLevel := 2;
- global gWindowLevel := 2;
- global gAppTestLevel := 2;
-
- end;
- else if( pTestLevel = 3)
- begin
- LogStr( "==== The test level is '{pTestLevel}' - (Most amount of testing) =====");
-
- global gFontLevel := {2,3};
- global gDrawLevel := {2,3};
- global gWindowLevel := {2,3};
- global gAppTestLevel := 3;
- end;
-
-
- if (pCustomSetting)
- begin
- for each testLevel in pCustomSetting
- begin
- whichMethod := testLevel[1];
- testsettings := testLevel[2];
- if(whichMethod = 'DrawLevel')
- begin
- LogStr(" Custom gDrawLevel := {testsettings}");
- global gDrawLevel := testsettings;
- end;
- else if(whichMethod = 'FontLevel')
- begin
- LogStr( " Custom gFontLevel := {testsettings}");
- global gFontLevel := testsettings;
- end;
- else if(whichMethod = 'WindowLevel')
- begin
- LogStr( " Custom gWindowLevel := {testsettings}");
- global gWindowLevel := testsettings;
- end;
- else if(whichMethod = 'AppTestLevel')
- begin
- LogStr( " Custom gAppTestLevel := {testsettings}");
- global gAppTestLevel := testsettings;
- end;
- end;
- end;
- end; # SetTestLevel()
-
-